const {
    Mysql
} = require('../../tools');

module.exports = async ctx => {
    try {
        let {
            name,
            config
        } = ctx.request.body;
        let sql = `REPLACE INTO config(name,config) VALUES('${name}','${config}')`;
        await Mysql(sql);
        ctx.state.data = {
            code: '001',
            msg: 'ok'
        }
    } catch (error) {

    }
}